package com.bolt.core.view.components;

import com.bolt.common.utils.StrUtil;

import java.text.DecimalFormat;
import java.text.NumberFormat;


public class NumberHtmlRender implements HtmlRender {
	private static final String FORMAT_TEXT="#,###.00";
	@Override
    public String render(Object parent, Object data, String format){
		if(data== null){
			return "";
		}
		DecimalFormat decimalFormat = new DecimalFormat(StrUtil.emptyIf(format, FORMAT_TEXT));
		NumberFormat mumformat = NumberFormat.getCurrencyInstance();
		return mumformat.format(decimalFormat.format(data));
		
	}

}
